package com.baizhi.controller;


import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import com.baizhi.entity.BzAdmin;
import com.baizhi.entity.PmsBrand;
import com.baizhi.service.IPmsCategoryService;
import com.baizhi.vo.CascaderNodeVo;
import com.baizhi.vo.CategoryVo;
import com.baizhi.vo.ZtreeVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 商品三级分类 前端控制器
 * </p>
 *
 * @author xhc
 * @since 2020-09-26
 */
@RestController
@RequestMapping("category")
public class PmsCategoryController {

    @Resource
    private IPmsCategoryService pmsCategoryService;

    @RequestMapping("selectAll")
    public Map selectAll() {

        List<CategoryVo> categoryVos = pmsCategoryService.selectCategorysByStream();
        Map map = new HashMap<>();
        map.put("code",0);
        map.put("msg",0);
        map.put("data",categoryVos);
        return map;
    }

    @RequestMapping("selectAll_ztree")
    public List<ZtreeVo> selectAll_ztree() {

        List<ZtreeVo> list = pmsCategoryService.selectZtreeCategorysByStream();
        return list;
    }

    @RequestMapping("getCascaderNodeVos")
    public List<CascaderNodeVo> getCascaderNodeVos(){
        return pmsCategoryService.getCascaderNodeVos();
    }


}
